package com.impltest.demo8.controller;

import com.alibaba.fastjson.JSONObject;
import com.interfacetest.demo7.service.AService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * @author ext.yanghua1
 * 2023/6/9 11:41
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private AService aService;

    @GetMapping("/query")
    public void test(){
        try {
            Map<String, Object> map = aService.execute("abc", "abc");
            System.out.println(JSONObject.toJSONString( map));
        } catch (ExecutionException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
